package aframe.http.bean;

import java.util.ArrayList;

import aframe.utils.StringUtils;



public class HttpCookie {
	private ArrayList<String> mKeys = new ArrayList<String>();
	private ArrayList<String> mValues = new ArrayList<String>();

	public void add(String key, String value) {
		if (StringUtils.isNotBlank(key) && value != null) {
			this.mKeys.add(key);
			this.mValues.add(value);
		}
	}

	public int size() {
		return mKeys.size();
	}

	public String getKey(int location) {
		if (location >= 0 && location < this.mKeys.size()) {
			return this.mKeys.get(location);
		}
		return "";
	}

	public String getValue(int location) {
		if (location >= 0 && location < this.mKeys.size()) {
			return this.mValues.get(location);
		} else {
			return "";
		}
	}

	public void clear() {
		this.mKeys.clear();
		this.mValues.clear();
	}
	
}
